package cn.tedu.gatewaybeijing.controller;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.ZonedDateTime;

@RestController
public class BeijingController {
    @GetMapping("/bj/show")
    public String hello(){

        ZonedDateTime time = ZonedDateTime.now();
        System.out.println(time);

        return "北京欢迎你";
    }

    @GetMapping("/bj/hello")
    public String hello1(String name){
        return "北京欢迎你"+name;
    }

    @GetMapping("/bj/test")
    public String hello2(@RequestHeader("color") String header,
                         @RequestParam("age") Integer age){
        return "北京欢迎你"+"年龄为"+age+"请求头:"+header;
    }
}
